Skip to content

WIP - cleanup(sidekick): read-only api.T types - #7869

Draft
coryan wants to merge 2 commits into
googleapis:mainfrom
coryan:feat/readonly-api-v2
Draft

coryan wants to merge 2 commits into
googleapis:mainfrom
coryan:feat/readonly-api-v2

Conversation

@coryan

@coryan coryan commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

DO NOT REVIEW

This is the end of a long list of PRs towards #7837. The idea is to make the api.T types read-only, so once initialized by the parsers (or tests) they can only get annotations in the codec. It is harder to use the types incorrectly, probably easier to fix things, and constraint the mistakes that LLMs can make.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the api package to use builder patterns for constructing API, Message, Service, Method, PathBinding, PathInfo, PathSegment, PathVariable, Resource, ResourceReference, OperationInfo, RoutingInfo, RoutingInfoVariant, and SampleInfo types. It also encapsulates struct fields and provides getter methods for access. The review comment correctly identifies a missing variadic expansion operator in the WithSignatures call within methods.go.

@coryan
coryan force-pushed the feat/readonly-api-v2 branch from bce3596 to b34a269 Compare October 30, 2026 00:07
Comment thread internal/sidekick/api/path_segment.go Resolved
@coryan
coryan force-pushed the feat/readonly-api-v2 branch 5 times, most recently from bd46a4a to 84bb780 Compare November 5, 2026 19:55
@coryan
coryan force-pushed the feat/readonly-api-v2 branch 3 times, most recently from 87ca068 to f397abe Compare November 12, 2026 21:57
@coryan
coryan force-pushed the feat/readonly-api-v2 branch from f397abe to c9b9933 Compare November 20, 2026 12:13
Add a generic (*API).Filter method to construct a filtered copy of an

API surface, keeping Rust/prost-specific reachability rules in

internal/librarian/rust/generate_prost_hybrid.go.

Part of googleapis#7837
Make API fields private with getters and APIBuilder.

Part of googleapis#7837

Closes googleapis#7857
@coryan
coryan force-pushed the feat/readonly-api-v2 branch from c9b9933 to d1504d7 Compare November 20, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants